<%- include('header.html') -%>

    <div class="container mt-5">
        <h2 class="mb-4">搜索结果（搜索词:<%= keyword %>）</h2>
        <div class="row row-cols-4">
            <% articles.forEach(article => { %>
                <div class="col my-3">
                    <div class="card h-100">
                        <img data-src="holder.js/100px150" class="card-img-top" alt="...">
                        <div class="card-body">
                            <h5 class="card-title"><%= article.title %></h5>
                            <p class="card-text"><small class="text-muted"><%= article.time.toLocaleString() %></small></p>
                            <p class="card-text"><%= article.content.replace(/<[^>]+>/g,'').substring(0,50) %>...</p>
                            <a href="/article/<%=article.id%>" class="stretched-link"></a>
                        </div>
                    </div>
                </div>
            <% }) %>
        </div>
    </div>

<!-- 引入尾部 -->
<%- include('footer.html') -%>